package com.yunsc.system.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.yunsc.common.validator.ValidationGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @version: 1.0
 * @Author: adan
 * @description: 店铺用户DTO
 * @date: 2024-04-21 16:05
 */
@ApiModel(value = "店铺用户DTO")
@Data
public class StoreUserDTO {

    @JsonProperty("userId")
    @ApiModelProperty(value = "用户id")
    @NotNull(message = "用户id不能为空", groups = {ValidationGroups.Delete.class, ValidationGroups.Update.class})
    private Integer userId;
    private StoreUserForm form;

    @Data
    public static class StoreUserForm {
        @NotNull(message = "用户姓名不能为空", groups = {ValidationGroups.Update.class})
        private String realName;
        @NotNull(message = "用户名不能为空", groups = {ValidationGroups.Update.class})
        private String userName;
        @NotNull(message = "用户密码不能为空", groups = {ValidationGroups.Update.class})
        private String password;
        @NotNull(message = "用户密码不能为空", groups = {ValidationGroups.Update.class})
        private String passwordConfirm;
        private Integer sort;
        private List<Integer> roles;
    }
}
